<?
require_once("../config/dbconn.php");require_once("../config/usercls.php");require_once("../config/pagecls.php");require_once("pwd1cls.php");
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	
}
td{
font-size:12px;
}
-->
</style>

<link href="images/skin.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="nowtable">
      <tr>
        <td align="center" class="title">奖金查询</td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="30" align="center"><form name="form1" method="post" action="?action=query">
      期数：
      <label>
      <select name="periods">
        <option value="">全部期数</option>
        <?
		  $sqlpr="select * from {$db_prefix}salary where state>=1";
		  $resultpr=$db->query($sqlpr);
		  while($rspr=$db->fetch_array($resultpr)){
		  		echo "<option value='".$rspr['periods']."'>{$rspr['periods']}</option>";
		  }
		  $db->free_result($resultpr);
		  ?>
      </select>
      </label>
      <label>
      <input type="submit" name="Submit" value="查询">
      </label>
        
	奖金累计：<?
	 $sql="select * from {$db_prefix}users where id='".$_SESSION['sys_userid']."'";
  $rs=$db->get_one($sql);
  echo $rs['priceall'];
	?>
	</form>
    <table width="100%" height="60" border="0" cellpadding="5" cellspacing="1" bgcolor="#e4f1fb">
      <tr>
        <td height="30" align="center"  >期数</td>
        <td align="center"  >成员</td>
        <td align="center"  >级别</td>
        <td align="center"  >是否已经发放</td>
        <td align="center"  >发放时间</td>
        <td align="center"  ><p >推荐奖</p></td>
        <td align="center"  ><p >对碰奖</p></td>
        <td align="center"  ><p >管理基金</p></td>
        <td align="center"  ><p >A区见点</p></td>
        <td align="center"  ><p >幸运奖</p></td>
        <td align="center"  ><p >分红股权</p></td>
        <td align="center"  >全部奖金</td>
      </tr>
	  <tbody bgcolor="#FFFFFF">
      <?
  $query='';
  if ($action=='query'){
  	if (trim($periods)!='') $query.=" and periods='".trim($periods)."'";
  }
  $sql="select count(id) as c  from {$db_prefix}salary1 where userid='".$_SESSION['sys_userid']."' and isff=1";
  if ($query!='') $sql.=$query;
  $rs=$db->get_one($sql);
  $page=new pagecls(20,intval($rs['c']));
  $sql="select * from {$db_prefix}salary1 where userid='".$_SESSION['sys_userid']."' and isff=1";
  if ($query!='') $sql.=$query;
  $sql.=" order by id desc limit {$page->pastnum},{$page->pagesize}";
  $result=$db->query($sql);
  while($rs=$db->fetch_array($result)){
  	$total=$rs['dpprice']+$rs['ggfprice']+$rs['jtprice']+$rs['luckprice']+$rs['fhprice']+$rs['gpjprice'];
  ?>
      <tr>
        <td height="30" align="center"><label></label>
              <?=$rs['periods']?></td>
        <td align="center"><?=$rs['username']?>
        </td>
        <td align="center" ><?=$hyrankary[$rs['rank']]?></td>
        <td align="center" ><? if ($rs['isff']==1) echo "已经发放";else echo "没有发放";?></td>
        <td align="center" ><? if ($rs['fftime']) echo date("Y-m-d H:i:s",$rs['fftime'])?></td>
        <td align="center" ><?
				  echo $rs['ggfprice'];
				  ?></td>
        <td align="center" ><?
				  echo $rs['dpprice'];
				  ?></td>
        <td align="center" ><?
				  echo $rs['jtprice'];
				  ?></td>
        <td align="center" ><?
				  echo $rs['fhprice'];
				  ?></td>
        <td align="center" ><?
				  echo $rs['luckprice'];
				  ?></td>
        <td align="center" ><? 
				 
				  echo $rs['gpjprice'];
				  ?></td>
        <td align="center" ><?=$total?></td>
      </tr>
      <?
  }
  $db->free_result($result);
  ?>
  </tbody>
    </table></td>
  </tr>
  <tr>
    <td height="30">&nbsp;</td>
  </tr>
  <tr>
    <td height="30" align="right">每页
        <?=$page->pagesize?>
      条 第
      <?=$page->pageno?>
      /
      <?=$page->pagenum?>
      页 共
      <?=$page->recnum?>
      条 <a href='?<?=$page->url?>1'><img src="image1/first.gif" border="0"></a> <a href='?<?=$page->url.($page->pageno-1)?>'><img src="image1/back.gif" border="0"></a> <a href='?<?=$page->url.($page->pageno+1)?>'><img src="image1/next.gif" border="0"></a> <a href='?<?=$page->url.$page->pagenum?>'><img src="image1/last.gif" border="0"></a></td>
  </tr>
  <tr>
    <td height="30"></td>
  </tr>
</table>
</body>
</html>
